<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<body>
<div class="ui right pagination menu" th:fragment="pageNav(pageInfo, prevText, nextText, prefix)">
    <th:block th:if="${pageInfo.hasPreviousPage}">
        <div class="item"><a th:href="@{'/'+${prefix}+'/'+${pageInfo.prePage}}" th:text="${prevText}"></a></div>
    </th:block>


    <th:block th:each="navIndex :${ pageInfo.navigatepageNums}">
        <div class="item" th:classappend="${pageInfo.pageNum==navIndex} ? 'active'"><a th:href="@{'/page/'+${navIndex}}"
                                                                                       th:text="${navIndex}"></a></div>
    </th:block>


    <th:block th:if="${pageInfo.hasNextPage}">
        <div class="item"><a th:href="@{'/'+${prefix}+'/'+${pageInfo.nextPage}}" th:text="${nextText}"></a></div>
    </th:block>
</div>

<!--<div class="ui bottom attached segment" th:if="${page.totalPages}>1">
    <div class="ui middle aligned two column grid">
        <div class="column">
            <a href="#" th:href="@{/(page=${page.number}-1)}"  th:unless="${page.first}" class="ui mini teal basic button">上一页</a>
        </div>
        <div class="right aligned column">
            <a href="#" th:href="@{/(page=${page.number}+1)}"  th:unless="${page.last}" class="ui mini teal basic button">下一页</a>
        </div>
    </div>
</div>-->


<div th:fragment="pageAdminNav(pageInfo)">
    <div class="clearfix">
        <ul class="pagination m-b-5 pull-right">
            <li th:if="${pageInfo.hasPreviousPage}">
                <a th:href="@{'?page='+${pageInfo.prePage}}" aria-label="Previous">
                    <i class="fa fa-angle-left"></i>&nbsp;上一页
                </a>
            </li>

            <th:block th:each="nav : ${pageInfo.navigatepageNums}">
                <li th:class="${nav==pageInfo.pageNum}?'active':''"><a th:href="@{'?page='+${nav}}"
                                                                       th:text="${nav}"></a>
                </li>
            </th:block>

            <th:block th:if="${pageInfo.hasNextPage}">
                <li>
                    <a th:href="@{'?page='+${pageInfo.nextPage}}" aria-label="Next">
                        下一页&nbsp;<i class="fa fa-angle-right"></i>
                    </a>
                </li>
            </th:block>

            <li><span th:text="'共'+${pageInfo.pages}+'页'"></span></li>
        </ul>
    </div>
</div>

</body>
</html>